package num2;

/**
 * @Question num2.MyCube
 * @Date 2022/12/24 9:18
 * @Solution
 */
public class MyCube implements ShapeArea{
    public static void main(String[] args) {
        MyCube cube = new MyCube(3,4,5);
        cube.getArea();
    }
    double leight;
    double width;
    double height;
    public MyCube() {
        this.leight=0;
        this.width=0;
        this.height=0;
    }

    public MyCube(double leight, double width, double height) {
        this.leight = leight;
        this.width = width;
        this.height = height;
    }

    @Override
    public void getArea() {
        double area=0;
        area+=(height*width)*2;
        area+=(leight*width)*2;
        area+=(height*leight)*2;
        System.out.println("长方体长宽高分别为："+leight+","+width+","+height+"六个面对的面积和是："+area);
    }
}
